Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle syncing UUID arrays into BQ #2358

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

lukejudd-lux
Copy link
Contributor

Building on top of #2327 there are some missing pieces required to sync this data into BQ

Have tested these changes locally
image

Using this setup

#!/usr/bin/env bash
set -xeuo pipefail

# This script creates databases on the PeerDB internal cluster to be used as peers later.

CONNECTION_STRING="${1:-postgres://postgres:postgres@localhost:9901/postgres}"

if ! type psql >/dev/null 2>&1; then
  echo "psql not found on PATH, exiting"
  exit 1
fi

psql "$CONNECTION_STRING" << EOF

--- Create the databases
DROP DATABASE IF EXISTS source;
CREATE DATABASE source;
DROP DATABASE IF EXISTS target;
CREATE DATABASE target;

--- Switch to source database
\c source

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

--- Create the source table
DROP TABLE IF EXISTS source CASCADE;
CREATE TABLE source (
    id uuid DEFAULT uuid_generate_v4(),
    related_ids uuid[],
    PRIMARY KEY (id)
);

CREATE PUBLICATION source_publication FOR TABLE source;

-- insert mock rows into source with valid uuid values
-- INSERT INTO source (related_ids) VALUES (ARRAY[uuid_generate_v4(), uuid_generate_v4()]);

-- Switch to target database
\c target

EOF

@serprex serprex requested a review from iskakaushik December 16, 2024 14:35
@iskakaushik iskakaushik merged commit e0d7e7a into PeerDB-io:main Dec 16, 2024
5 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants